
///
/// This is the Client class
///

#ifndef CLIENT_H
#define CLIENT_H

#include "Handler.h"
#include <map>
#include <string>

class Client
{

public:


	int Initialize(const char* ip, const char* portNo, const char* uri);

	// we'll see about other constructors

	int Execute();

	static Client* GetInstance() { if(mClient == NULL) mClient = new Client; return mClient; }

	static void Destroy() { if(mClient) delete mClient; }
	
	int Die();

private:
	
	// private constructor for singleton
	Client() {}
	
	int SendGet();

	int mMainFD;

	std::string mURI;
	
	fd_set mConnectedFDS;
	int mMaxFD;

	char mMsgBuf[MAX_CONTENT_BUF_SIZE];

	static Client* mClient;

	Handler* mMsgHandler;
};

#endif //CLIENT_H
